-- GENERATED SPELL FOR [Ethereal Darkcaster] --


function spell0_18331(pUnit, Event) --@Mana Burn,n/a--
pUnit:FullCastSpellOnTarget(34930,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18331', 2000, 1)
end

function spell1_18331(pUnit, Event) --@Mana Burn,n/a--
pUnit:FullCastSpellOnTarget(34931,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18331', 2000, 1)
end

function spell2_18331(pUnit, Event) --@Shadow Word: Pain,n/a--
pUnit:FullCastSpellOnTarget(34942,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18331', 18000, 1)
end

function spell3_18331(pUnit, Event) --@Shadowform,Self--
pUnit:FullCastSpellOnTarget(16592,pUnit)
pUnit:RegisterEvent('Sorts_18331', 595, 1)
end

function Sorts_18331(pUnit, Event)
local choix_sorts_18331 = math.random(0, 3)
if choix_sorts_18331 == 0 then
pUnit:RegisterEvent('spell0_18331', 1, 1)
end
if choix_sorts_18331 == 1 then
pUnit:RegisterEvent('spell1_18331', 1, 1)
end
if choix_sorts_18331 == 2 then
pUnit:RegisterEvent('spell2_18331', 1, 1)
end
if choix_sorts_18331 == 3 then
pUnit:RegisterEvent('spell3_18331', 1, 1)
end
end

function mob18331_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_18331', math.random(1500, 3000), 1)
end

function mob18331_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18331_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18331_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(18331, 1, 'mob18331_Action')
RegisterUnitEvent(18331, 2, 'mob18331_Leave')
RegisterUnitEvent(18331, 3, 'mob18331_Kill')
RegisterUnitEvent(18331, 4, 'mob18331_Die')
